<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditOrdersTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditOrdersLabel_id}" for="id" />
                    <h:inputText id="id" value="#{ordersController.selected.id}" title="#{bundle.EditOrdersTitle_id}" required="true" requiredMessage="#{bundle.EditOrdersRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.EditOrdersLabel_createddate}" for="createddate" />
                    <h:inputText id="createddate" value="#{ordersController.selected.createddate}" title="#{bundle.EditOrdersTitle_createddate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditOrdersLabel_paymenttype}" for="paymenttype" />
                    <h:inputText id="paymenttype" value="#{ordersController.selected.paymenttype}" title="#{bundle.EditOrdersTitle_paymenttype}" />
                    <h:outputLabel value="#{bundle.EditOrdersLabel_customerid}" for="customerid" />
                    <h:selectOneMenu id="customerid" value="#{ordersController.selected.customerid}" title="#{bundle.EditOrdersTitle_customerid}" required="true" requiredMessage="#{bundle.EditOrdersRequiredMessage_customerid}">
                        <f:selectItems value="#{customerController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{ordersController.update}" value="#{bundle.EditOrdersSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditOrdersViewLink}"/>
                <br />
                <h:commandLink action="#{ordersController.prepareList}" value="#{bundle.EditOrdersShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditOrdersIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
